﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QuanLyHocBongSinhVien.VO;
using QuanLyHocBongSinhVien.DAO;
using System.Data.SqlClient;
using System.Data;

namespace QuanLyHocBongSinhVien.Bus
{
   public class LoaiHocBong_Bus
    {
       LoaiHocBong_DAO lhb=new LoaiHocBong_DAO();
       List<LoaiHocBong_VO> list = new List<LoaiHocBong_VO>();

       public List<LoaiHocBong_VO> getAllLoaiHocBong()
       {
           DataTable loai = new DataTable();
           List<LoaiHocBong_VO> l = new List<LoaiHocBong_VO>();
           foreach (DataRow r in loai.Rows)
           {
               LoaiHocBong_VO loaihb = new LoaiHocBong_VO();
               loaihb.MaHB = r[0].ToString();
               loaihb.TenHB = r[1].ToString();
               loaihb.NhaTaiTro = r[2].ToString();
               loaihb.GhiChu = r[3].ToString();
               loaihb.ChiTieu = (int)r[4];
           }
           return l;
       }

       public DataTable GetAllLoaiHB()
       {
           return lhb.getAllLoaiHB();
       }

       public DataTable getMaHB1()
       {
           return lhb.getMaHB();
       }

       public void Add(string m, string t, string n, string g, int c)
       {
           lhb.themLHB(m, t, n, g, c);
       }

       public void Update(string m, string t, string n, string g, int c)
       {
           lhb.suaLHB(m, t, n, g, c);
       }

       public void Delete(string m)
       {
           lhb.xoaLHB(m);
       }

       public void TimKiemMa(string ma)
       {
           lhb.timkiemLHB(ma);
       }

       public void TimKiemTen(string ma)
       {
           lhb.timkiemTenLHB(ma);
       }
       public void TimKiemTenNTT(string ma)
       {
           lhb.timkiemTenNTT(ma);
       }

       public void TimKiemChiTieu(int ct)
       {
           lhb.timkiemCT(ct);
       }
    }
}
